<template>
  <div>
    <input type="text" placeholder="请输入您想要保存的的值" v-model="n">
    <br>
    <button @click="direct">直接保存</button>&nbsp;<button @click="delay">延时1s异步保存</button>
  </div>
</template>

<script>

export default {
  name:"Inputresult",
  data() {
    return {
      n:null,
    }
  },
  methods: {
    direct(){
      this.$store.dispatch('direct',this.n),
      this.n=null
    },
    delay(){
      this.$store.dispatch('delay',this.n)
      this.n = null
    }
  },
}
</script>

<style>

</style>